class_name Retard extends Effect

#var life:TimeType = TimeType.HIT#生命周期
#var effect_type:EffectType = EffectType.STACKABLE#叠加类型
#signal effect_end#效果结束时发出
#var cue_list:Array[Cue] = []# cue列表
#var AS:AbilitySystem# 当前的AbilitySystem

func in_effect(_target) -> void:
	self.AS = _target
	self.life = TimeType.TIMES
	self.effect_type = EffectType.SINGLE
	self.cue_list.append(GC_冰)
	effect_apply()
	pass

# 对宿主身上的角色属性数据进行修改
# 在AbilitySystem组件中进行生命周期管理并调用
func effect_apply() -> void:
	self.create_cue()
	self.AS.change_hp(-60,"冰")
	var time_life = Timer.new()
	self.AS.add_child(time_life)
	time_life.wait_time = 2.0
	time_life.timeout.connect(end_effect)
	time_life.start()
	self.AS.attribute.减速效果 = 0.9
	pass


# 当临时效果结束时需要还原数据
func end_effect():
	self.AS.attribute.减速效果 = 0.0
	self.effect_end.emit()
	
